package cn.codingjc.peekaboo.application.util;

import cn.codingjc.peekaboo.infrastructure.persistence.po.SysUserPO;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @date: 2023/5/8
 * @author: Codingjc
 * @className: SecurityUtil
 **/
public class SecurityUtils {

    public static SysUserPO getLoginUser(){
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        return (SysUserPO) authentication.getPrincipal();
    }
}
